import request from '@/utils/request'
import {member} from './prefixApi.js'

// 获取验证码方法
export function getCode(mobile) {
   /*  const data = {
      username,
      password,
      code,
      uuid
    } */
   const data = {
     phone:mobile,
   }
   return request({
     url: `/auth/app/sendSms`,
     method: 'get',
     data:data
   })
  }
  
//省平台获取验证码
 
// 获取验证码方法
export function getCodeProvince(data) {
   return request({
     url: `/auth/app/sendValidateCode`,
     method: 'get',
     data:data
   })
}
  
// 注册
export function register(form) {
    /* const data = {
      username,
      password,
      userType,
      mobile:'123'
    } */
    return request({
      url:`/auth/app/register`,
      method: 'post',
      data: form
    })
  }
  
  // 注册
  export function registerByMobile(form) {
      /* const data = {
        username,
        password,
        userType,
        mobile:'123'
      } */
      return request({
        url:`/auth/web/register`,
        method: 'post',
        data: form
      })
    }
  
// 用户名查重
  export function existByUsername(username) {
    const data = {
      username
    }
    return request({
		url: `${member}/web/members/existByUsername`,
		method: 'get',
		data: data
    })
  }